import type { CodeType, User, UserInfo } from '@/types/user'
import { request } from '@/utils/request'
// 密码登录接口
const loginByPassword = (mobile: string, password: string) => {
  return request<User>('login/password', 'post', { mobile, password })
}
// 发信息登录接口
const loginByMobile = (mobile: string, code: string) => {
  return request<User>('login', 'post', { mobile, code })
}
// 发验证码接口
const sendCode = (mobile: string, type: CodeType) => {
  return request<User>('code', 'get', { mobile, type })
}
const getUserInfo = () => request<UserInfo>('/patient/myUser', 'get')

export { loginByPassword, loginByMobile, sendCode, getUserInfo }
